#ifndef __INNEREVENT_H
#define __INNEREVENT_H

typedef enum EventPrivType
{
    IMMITED_PRIV = 0,
    HIGH_PRIV,
    LOW_PRIV,
    UNUSED_PRIV,
} EventPrivType;
typedef enum EventType
{
    IMMITEDTYPE = 0,
    CIRCLETYPE,
    OVERTYPE,
    PUBTYPE,
    SUBTYPE,
    UNUSEDTYPE,
} EventType;

typedef struct InnerFunction_S
{
    void (*callback)(uint8_t *param, uint8_t len);
    uint8_t *param;
    uint8_t len;
} InnerFunction_S;
typedef struct InnerTopic_S
{
  union 
  {
    uint32_t numTopic;
    char[16] strTopic;
  }topic;
  
} InnerTopic_S;
typedef struct InnerTimer_S
{
    uint32_t timeOut;
    uint32_t count; /**如果count = 0xffffff*/
    EventPrivType pri;
} InnerTimer_S;
typedef struct InnerEvent_S
{
    uint32_t sessionId; 
    enum EventType eventType;
    MutexId mutex;
    InnerTopic_S *topicName;
     InnerFunctionNode_S *innerFun;
    InnerTimer_S *innerTimer;

} InnerEvent_S;
typedef struct InnerEventPool_S
{
    int maxPoolSize;
    InnerEvent_S *ptrPool;
}InnerEventPool_S;
struct InnerFunPacket_S
{
    struct InnerFunctionNode_S *innerFun;
    enum EventType eventType;
    enum EventPrivType pri;
    uint32_t timeOut;
    uint32_t count;
};
/// @brief 创建一个inner
//struct InnerEvent *InnerEventCreateString(char *topicName);

/// @brief 删除一个inner
//struct InnerEvent *InnerEventCreateNumber(uint32_t topicNum);
//struct InnerEvent *InnerEventCreateCallback(void (*callback)(void *), void *param, uint8_t pri);
int InnerEventDelete(struct InnEvent *innerEvent);
struct InnerEvent_S *InnerEventCreateNumber(struct InnerEventPool_S *pool, uint32_t numTopic, EventType evenType, InnerFunction_S *innerFunction);
#endif